﻿Imports Logica
Imports System.Windows.Forms

Public Class frmNotasdeCredito


    Public p As frmInicio = New frmInicio

    Public ticketOriginal As String
    Public puntoVentaOriginal As Integer


    Public Sub agregar(ByRef pp As frmInicio)

        p = pp

    End Sub


    Private Sub btnBuscarNC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBuscarNC.Click

        ticketOriginal = txtNroTicketOriginal.Text
        puntoVentaOriginal = txtPuntoVenta.Text

        If AccesoLogica.buscarTicketNC(puntoVentaOriginal, ticketOriginal) Then

            dgvNC.AutoGenerateColumns = False
            dgvNC.DataSource = AccesoLogica.getArrayItemNC()

        Else
            MessageBox.Show("No se encontro los datos del ticket original.", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information)
        End If

    End Sub



    Private Sub btnImprimirNC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnImprimirNC.Click

        ticketOriginal = txtNroTicketOriginal.Text
        puntoVentaOriginal = txtPuntoVenta.Text


        AccesoLogica.imprimirNotaCredito(ticketOriginal, puntoVentaOriginal)

    End Sub

    Private Sub frmNotasdeCredito_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

End Class